<?php
/* @var $this BitacoraController */
/* @var $model bitacora */




Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#bitacora-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Bitácora</h1>


<?php echo CHtml::link('Búsqueda avanzada','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php 
/*$this->widget('application.extensions.PageSize.PageSize', array(
        'mGridId' => '<grid-id>', //Gridview id
    'mPageSize' => @$_GET['pageSize'],
        'mDefPageSize' => Yii::app()->params['defaultPageSize'],
        'mPageSizeOptions'=>Yii::app()->params['pageSizeOptions'],// Optional, you can use with the widget default
)); */
?>


<div align="right">
<?php
    $this->widget('ext.PageSize.EPageSize', array(
    'gridViewId' => 'bitacora-grid',
    'beforeLabel'=>'Registro por pantalla: ',
    'pageSize' => Yii::app()->request->getParam('pageSize',null),
    'defaultPageSize' =>  10 ,   // may use this :  Yii::app()->params['defaultPageSize'],
    'pageSizeOptions'=> array(5=>5, 10=>10, 25=>25, 50=>50, 75=>75, 100=>100), // you can config it in main.php under the config dir . Yii::app()->params['pageSizeOptions'],// Optional, you can use with the widget default
    ));
    ?>
 
 
<?php
$dataProvider = $model->search();
$pageSize = Yii::app()->user->getState('pageSize',10/*Yii::app()->params['defaultPageSize']*/);
$dataProvider->getPagination()->setPageSize($pageSize);
 
 ?>

</div>



<?php $this->widget('bootstrap.widgets.TbGridView', array(
	'type'=>'striped bordered condensed',
	'id'=>'bitacora-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'template'=>"{summary}{items}{pager}",
	'itemsCssClass'=>'table table-striped table-bordered table-condensed tableNews',// mover por fila
    'enablePagination' => true,
	//'template'=>"{items}",
	//'htmlOptions'=>array('style'=>'word-wrap:break-word; width:1050px;'),
	'columns'=>array(
		array('name'=>'Bi_asunto','header'=>'Asunto'),
		array('name'=>'Bi_fecha','header'=>'Fecha'),
		array('name'=>'Bi_accion', 'header'=>'Acción'),		
			
		
	),
)); ?>